﻿using Harmontronics.Api.Config;
using Harmontronics.IService;
using Harmontronics.IService.Business;
using Harmontronics.Model.Dto;
using Harmontronics.Model.Dto.Business;
using Harmontronics.Model.Dto.Login;
using Harmontronics.Model.Dto.Model;
using Harmontronics.Model.Dto.User;
using Harmontronics.Model.Entitys;
using Harmontronics.Model.Other;
using Harmontronics.Service;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;
using Org.BouncyCastle.Crypto;
using System.Collections.Generic;

namespace Harmontronics.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    // [Authorize]
    [ApiController]
    public class PartDetailController : ControllerBase
    {   
        private IPartDetailsService _partDetailsService;

        public PartDetailController(IPartDetailsService partDetailsService)
        { 
            _partDetailsService = partDetailsService;
        }

        [HttpGet]
        public ApiResponseData GetPartDetailsData()
        {
            List<PartDetailModel> models = _partDetailsService.GetPartDetails();
            return ResultHelper.Success(new ReturnData() { total = models.Count, dataList = models });
        }


    }
}
